package com.xw.stream;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

/**
 * @author: xw
 * @create: 2023/5/11 14:58
 * @description:操作stream
 */
public class Code03_OpStream01 {
    public static void main(String[] args) {
        List<String> list = new ArrayList();
        list.add("万");
        list.add("猫");
        list.add("学");
        list.add("社");
        long count = list.stream().distinct().count();
        System.out.println(count);

        boolean isExist = list.stream().anyMatch(element -> element.contains("猫"));
        System.out.println(isExist);

        Stream<String> stream = list.stream().filter(element -> element.contains("猫"));
      

    }
}
